<?php $obHoadon =  $this->obHoadon ?>

<div id="frmthanhtoan">
	
	<div class="header">
		<img alt="" src="<?php echo _BASE_URL ?>/public/resources/logo_TCoffee.png" />
		<h2>PHIẾU THANH TOÁN</h2>
	</div>
	
	<div class="thongtin">
		<table>
			<tr>
				<td width="80px">Số phiếu: </td> 
				<td width="100px"> <strong> <?php echo $obHoadon['Sophieu'] ?> </strong> </td>
				<td> <strong> <?php echo $obHoadon['Ten'] ?> </strong> </td>
			</tr>
		</table>
	</div>
	
	<div class="chitiet">
		<table cellspacing="0" cellpadding="0">
			<thead> 
			<tr>
				<th width="100px" nowrap="nowrap">Món</th>
				<th width="110px;">Số lượng</th>
				<th>Đơn giá</th>
				<th style="text-align: center">Tiền</th>
			</tr>
			</thead>
			
			<?php foreach($obHoadon['Chitiet'] as $chitiet ) { ?>
			<tr>
				<td><div class="tenmon"> <?php echo $chitiet['Ten'] ?> </div></td>
				<td> <?php echo $chitiet['Soluong'] ?> </td>
				<td> <?php echo number_format($chitiet['GiaBan']) ?> </td>
				<td> <?php echo number_format(floatval($chitiet['GiaBan']) * floatval($chitiet['Soluong']))?> </td>
			</tr>
			<?php } ?>
			
			<tfoot>
			<tr>
				<th></th>
				<th></th>
				<th class="right">
					<p>Thành tiền: </p>
					<p>Giảm giá: </p>
					<p>Thanh toán: </p>
					<p>Khách đưa: </p>
					<p>Hoàn lại khách: </p>
					<p> </p>
				</th>
				<th class="right"> 
					<p> <?php echo number_format($obHoadon['Tongtienthanhtoan']) ?></p>
					<p> <?php echo number_format($obHoadon['Giamgia']) ?>%</p>
					<p> <?php echo number_format($obHoadon['Tienthanhtoan']) ?></p>
					<p> <?php echo number_format($obHoadon['Khachdua']) ?></p>
					<p> <?php echo $obHoadon['Tralai'] ?></p>
				</th>
			</tr>
			<tr>
				<td colspan="2">
					<i><strong>Ghi chú:</strong> <?php echo $obHoadon['Ghichu'] ?></i>
				</td>
			</tr>
			</tfoot>
		</table>
	</div>
</div>



<div class="tags_clear"></div>




<button type="button" class="btn btn-primary" id="btnthanhtoan" style="display: none"> In phiếu </button>

<script>
$("#btnthanhtoan").click(function(){
	$("#frmthanhtoan").print();


	//window.print();return false;
	//window.open('popup.html', 'thePopup', 'width=500,height=500');
});

//window.print();
</script>

<button onclick="window.print()" class="uk-button uk-float-left" style="display: none"> IN ngay </button>